package cn.gd.service.Login;

import cn.gd.mapper.LoginMapper.LoginMapper;
import cn.gd.pojo.Users;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private LoginMapper loginMapper;

    @Override
    public boolean queryUserLogin(String userName, String password) {
        Integer row = loginMapper.queryUserLogin(userName, password);
        return row > 0 && row!=null;
    }

    @Override
    public Users getUsers(String userName, String password) {
        Users users = loginMapper.getUsers(userName, password);
        return users;
    }

    @Override
    public Boolean updatePassword(Integer userID, String pwd) {
        int row = loginMapper.updatePassword(userID, pwd);
        return row > 0;
    }
}
